/// 成功
pub const FALSE: i32 = 0;
/// 失败
pub const TRUE: i32 = 1;
/// 超时错误码
pub const WAIT_TIMEOUT: i32 = 258;
///
pub const WSA_IO_PENDING: i32 = 997i32;
///
pub const WSA_INFINITE: u32 = 4294967295u32;

/// 通过进程启动 Winsock DLL 的使用
#[inline(always)]
pub fn wsa_startup() -> i32
{
    #[cfg(target_os = "windows")]
    unsafe {
        let mut wsa_data: windows_sys::Win32::Networking::WinSock::WSADATA = std::mem::zeroed();
        windows_sys::Win32::Networking::WinSock::WSAStartup(0x0202, &mut wsa_data as *mut windows_sys::Win32::Networking::WinSock::WSADATA)
    }
    #[cfg(not(target_os = "windows"))]
    -1
}
/// 终止使用 Winsock 2 DLL
#[inline(always)]
pub fn wsa_cleanup() -> i32
{
    #[cfg(target_os = "windows")]
    unsafe { windows_sys::Win32::Networking::WinSock::WSACleanup() }
    #[cfg(not(target_os = "windows"))]
    -1
}